package model

import (
	"database/sql"
	"prod/api/prod"
	"prod/pkg/orm"
)

type ProdTypeQueryModel struct {
	ProdType
	Subs  []*prod.ProdTypeView `gorm:"-"`
	Count uint32               `gorm:"column:count"` // 关联商品数量
}

type ProdQueryModel struct {
	*prod.SelectionProdView
	// p_store_id
	PStoreId  uint32          `gorm:"column:p_store_id"`
	Groups    orm.StringArray `gorm:"column:groups"`
	GroupJson orm.JSON        `gorm:"column:group_json"`
}

type MenuQueryModel struct {
	Menu
	StoreIds  string `gorm:"column:store_ids"`
	ProdCount uint32 `gorm:"column:prod_count"`
}

type MenuSkuQueryModel struct {
	ProdId    uint64          `gorm:"column:prod_id"`
	SkuId     uint64          `gorm:"column:id"`
	Items     orm.StringArray `gorm:"column:items"`
	MenuPrice sql.NullInt64   `gorm:"column:menu_price"`
	SkuPrice  uint32          `gorm:"column:sku_price"`
	Weight    uint64          `gorm:"column:weight"`
}
